package com.qianbao.service.user;

import com.qianbao.components.excepion.CommonException;
import com.qianbao.domain.user.ModifyPasswordEntity;
import com.qianbao.domain.user.UserEntity;

public interface SVUserService {


    /**
     * 保存用户数据
     * @param entity
     * @return
     */
    public int saveUser(UserEntity entity) throws CommonException;


    /**
     * 查询用户是否存在，是否注册
     * @param phone
     * @return
     */
    public boolean findUserByPhone(String phone) throws CommonException;


    /**
     * 登录/注册成功之后要查询用户数据
     * @param phone
     * @return
     */
    public UserEntity findRegisterUserByPhone(String phone);


    /**
     * 登录
     * @param entity
     * @return
     */
    public UserEntity loginAccount(UserEntity entity) throws CommonException;


    /**
     * 忘记登录密码
     * @param entity
     * @return
     * @throws CommonException
     */
    public boolean updateUserPassword(UserEntity entity) throws CommonException;


    /**
     * 退出登录
     * @return
     * @throws CommonException
     */
    public boolean logoutAccount() throws CommonException;


    /**
     * 修改用户的登陆密码--用户已经登录的情况
     * @return
     * @throws CommonException
     */
    public boolean modifyUserPassword(ModifyPasswordEntity entity) throws CommonException;


}
